home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / Developer Essentials Jul 90 / Programming / MPW Interfaces & Libraries 3.1 / CIncludes / StdLib.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-11-30  |  2.0 KB  |  117 lines  |  [TEXT/MPS ]

  1. /*
  2.     StdLib.h -- General utilities
  3.  
  4.     Copyright Apple Computer,Inc.    1987, 1988
  5.     All rights reserved.
  6.  
  7. */
  8.  
  9. #ifndef __STDLIB__
  10. #define __STDLIB__
  11.  
  12. #ifndef __STDDEF__
  13. #include <StdDef.h>
  14. #endif __STDDEF__
  15.  
  16.  
  17. typedef struct {
  18.     int quot;            /* quotient */
  19.     int rem;            /* remainder */
  20. } div_t;
  21.  
  22. typedef struct {
  23.     long int quot;        /* quotient */
  24.     long int rem;        /* remainder */
  25. } ldiv_t;
  26.  
  27.  
  28. #define EXIT_FAILURE 1
  29. #define EXIT_SUCCESS 0
  30.  
  31. #define RAND_MAX 32767
  32.  
  33. #define MB_CUR_MAX 1
  34.  
  35. #ifdef __safe_link
  36. extern "C" {
  37. #endif
  38.  
  39. /*
  40.  *    String conversion functions
  41.  */
  42.  
  43. double atof (const char *nptr);
  44. int atoi (const char *nptr);
  45. long int atol (const char *nptr);
  46. double strtod (const char *nptr, char **endptr);
  47. long int strtol (const char *nptr, char **endptr, int base);
  48. unsigned long int strtoul (const char *nptr, char **endptr, int base);
  49.  
  50.  
  51. /*
  52.  *    Pseudo-random sequence generation functions
  53.  */
  54.  
  55. int rand (void);
  56. void srand (unsigned int seed);
  57.  
  58.  
  59. /*
  60.  *    Memory management functions
  61.  */
  62.  
  63. void *calloc (size_t nmemb, size_t size);
  64. void free (void *ptr);
  65. void *malloc (size_t size);
  66. void *realloc (void *ptr, size_t size);
  67.  
  68.  
  69. /*
  70.  *    Communication with the environment
  71.  */
  72.  
  73. void abort (void);
  74. int atexit (void (*func)(void));
  75. void exit (int status);
  76. char *getenv (const char *name);
  77. int system (const char *string);
  78.  
  79.  
  80. /*
  81.  *    Searching and sorting utilities
  82.  */
  83.  
  84. void *bsearch (const void *key, const void *base,
  85.                size_t nmemb, size_t size,
  86.                int (*compar)(const void *, const void *));
  87. void qsort (void *base, size_t nmemb, size_t size,
  88.             int (*compar)(const void *, const void *));
  89.  
  90.  
  91. /*
  92.  *    Integer arithmetic functions
  93.  */
  94.  
  95. int abs (int j);
  96. div_t div (int numer, int denom);
  97. long int labs (long int j);
  98. ldiv_t ldiv (long int numer, long int denom);
  99.  
  100.  
  101. /*
  102.  *    Multibyte functions
  103.  */
  104.  
  105. int mblen (const char *s, size_t n);
  106. int mbtowc (wchar_t *pwc, const char *s, size_t n);
  107. int wctomb (char *s, wchar_t wchar);
  108. size_t mbstowcs (wchar_t *pwcs, const char *s, size_t n);
  109. size_t wcstombs (char *s, const wchar_t *pwcs, size_t n);
  110.  
  111.  
  112. #ifdef __safe_link
  113. }
  114. #endif
  115.  
  116. #endif __STDLIB__
  117.